package com.lry.basic.algorithm.common;

/**
 * @author:刘仁有
 * @desc:
 * @email:953506233@qq.com
 * @data:2020/1/4
 */
public class LengthOfLastWord {
    public static void main(String[] args) {
        System.out.println(lengthOfLastWord("    "));
    }

    public static int lengthOfLastWord(String s) {
        if(null==s||"".equals(s))return 0;
        String[]strs = s.split(" ");
        if(strs.length==0)return 0;
        return strs[strs.length-1].length();
    }
}
